/**
 * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.trade.entity;

import com.jeeplus.modules.goods.entity.Goods;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import javax.validation.constraints.NotNull;
import com.jeeplus.modules.member.entity.Member;

import com.jeeplus.core.persistence.DataEntity;
import com.jeeplus.common.utils.excel.annotation.ExcelField;

/**
 * 交易记录Entity
 * @author w
 * @version 2020-10-08
 */
public class Trade extends DataEntity<Trade> {
	
	private static final long serialVersionUID = 1L;
	private Goods goods;		// 商品id
	private String orderNo;		// 订单编号
	private Date tradeDate;		// 确定收款时间
	private Date payDate;		// 打款时间
	private Date placeDate;		// 提交订单时间
	private Date takeDate;		// 提货时间
	private Member member;		// 出售人
	private Member tomem;		// 购买人
	private String tradeStatus;		// 交易状态
	private String payType;		// 收款方式
	private String payImg;		// 打款凭证
	private String goodsId;
	private String goodsType;
	private String price;   //价格

	@ExcelField(title="商品价格", align=2, sort=3)
	public String getPrice() {
		return price;
	}

	public void setPrice(String price) {
		this.price = price;
	}

	public Trade() {
		super();
	}

	public Trade(String id){
		super(id);
	}

	@ExcelField(title="商品名称", fieldType=Goods.class, value="goods.name", align=2, sort=1)
	public Goods getGoods() {
		return goods;
	}

	public void setGoods(Goods goods) {
		this.goods = goods;
	}
	
	@ExcelField(title="订单编号", align=2, sort=3)
	public String getOrderNo() {
		return orderNo;
	}

	public void setOrderNo(String orderNo) {
		this.orderNo = orderNo;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@NotNull(message="确定收款时间不能为空")
	@ExcelField(title="确定收款时间", align=2, sort=4)
	public Date getTradeDate() {
		return tradeDate;
	}

	public void setTradeDate(Date tradeDate) {
		this.tradeDate = tradeDate;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@NotNull(message="打款时间不能为空")
	@ExcelField(title="打款时间", align=2, sort=5)
	public Date getPayDate() {
		return payDate;
	}

	public void setPayDate(Date payDate) {
		this.payDate = payDate;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@NotNull(message="提交订单时间不能为空")
	@ExcelField(title="提交订单时间", align=2, sort=6)
	public Date getPlaceDate() {
		return placeDate;
	}

	public void setPlaceDate(Date placeDate) {
		this.placeDate = placeDate;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@NotNull(message="提货时间不能为空")
	@ExcelField(title="提货时间", align=2, sort=7)
	public Date getTakeDate() {
		return takeDate;
	}

	public void setTakeDate(Date takeDate) {
		this.takeDate = takeDate;
	}
	
	@ExcelField(title="出售人", fieldType=Member.class, value="member.loginName", align=2, sort=11)
	public Member getMember() {
		return member;
	}

	public void setMember(Member member) {
		this.member = member;
	}
	
	@ExcelField(title="购买人", fieldType=Member.class, value="tomem.loginName", align=2, sort=12)
	public Member getTomem() {
		return tomem;
	}

	public void setTomem(Member tomem) {
		this.tomem = tomem;
	}
	
	@ExcelField(title="交易状态", dictType="orders_status", align=2, sort=13)
	public String getTradeStatus() {
		return tradeStatus;
	}

	public void setTradeStatus(String tradeStatus) {
		this.tradeStatus = tradeStatus;
	}
	
	@ExcelField(title="收款方式", dictType="payType", align=2, sort=14)
	public String getPayType() {
		return payType;
	}

	public void setPayType(String payType) {
		this.payType = payType;
	}
	
	@ExcelField(title="打款凭证", align=2, sort=15)
	public String getPayImg() {
		return payImg;
	}

	public void setPayImg(String payImg) {
		this.payImg = payImg;
	}
	@ExcelField(title="商品id", align=2, sort=2)
	public String getGoodsId() {
		return goodsId;
	}

	public void setGoodsId(String goodsId) {
		this.goodsId = goodsId;
	}

	public String getGoodsType() {
		return goodsType;
	}

	public void setGoodsType(String goodsType) {
		this.goodsType = goodsType;
	}
}